package com.tongtailian.www.stir.adapter;

import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.tongtailian.www.stir.R;
import com.tongtailian.www.stir.bean.NumberBean;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
 * Created by liuml on 2020/9/6 16:48
 */
public class SelectGroupAdapter extends BaseQuickAdapter<NumberBean, BaseViewHolder> {
    public SelectGroupAdapter(int layoutResId, @Nullable List<NumberBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, NumberBean item) {
        if (item.isSelect()) {
            helper.setBackgroundRes(R.id.bt_item_name, R.mipmap.location_icon_select);
            helper.setTextColor(R.id.bt_item_name, Color.parseColor("#ffffff"));
        }else {
            helper.setTextColor(R.id.bt_item_name, Color.parseColor("#000000"));
            helper.setBackgroundRes(R.id.bt_item_name, R.mipmap.location_icon_none);
        }
        helper.setText(R.id.bt_item_name, item.getName());
    }
}